<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>nth-of-type</title>
    <style>
      /* 这样就是 选中第三个子元素 */
      div > :nth-child(3) {
        color: red;
      }
      /* 这个东西 只数对应的元素 */
      div > div:nth-of-type(3) {
        color: blue;
      }
      div > div:nth-last-of-type(3) {
        color: purple;
        display: inline-block;
        background: #ddd;
        border-radius: 0;
        animation: rotateAmin 1s linear 0s infinite alternate;
      }

      @keyframes rotateAmin {
        from {
          transform: rotate(0deg);
          border-radius: 0;
        }
        to {
          transform: rotate(360deg);
          border-radius: 50%;
        }
      }
    </style>
  </head>
  <body>
    <div class="box">
      <div>我是列表1</div>
      <p>我是p元素</p>
      <p>我是p1元素</p>
      <div>我是列表2</div>
      <div>我是列表3</div>
      <div>我是列表4</div>
      <div>我是列表5</div>
      <div>我是列表6</div>
      <div>我是列表7</div>
      <div>我是列表8</div>
      <div>我是列表9</div>
      <div>我是列表10</div>
    </div>
  </body>
</html>
